﻿Imports System.Drawing.Printing

Public Class fListaPrinters
    Private lPrinter As String
    Public ReadOnly Property NombrePrinter() As String
        Get
            Return lPrinter
        End Get
    End Property
    Private Sub fListaPrinters_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        For Each Impresoras In PrinterSettings.InstalledPrinters
            lstPrinter.Items.Add(Impresoras.ToString)
        Next
    End Sub

    Private Sub btnAceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAceptar.Click
        If lstPrinter.SelectedItem IsNot Nothing Then
            lPrinter = lstPrinter.SelectedItem
            Me.DialogResult = Windows.Forms.DialogResult.OK
        End If
    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.DialogResult = Windows.Forms.DialogResult.Cancel
    End Sub
End Class